<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /* 
            ES6的继承  关键字  extends : 继承
        */
        // 父类
        class Animal{
            /* ES6的属性写在constructor当中 */
            constructor(name,age,gender){
                this.name = name;
                this.age = age;
                this.gender = gender;
            }
            eat(){
                console.log(this.name + "吃!");
            }
        }
        /* 鸡类 */
        class Ji extends Animal{}
        //身上应该有三个属性,与吃的方法
        let j = new Ji("公鸡",3,'男');
        j.eat();
        console.log(j);

    </script>
</body>
</html>